The LSAOrgaManager is the top class of the LSA Orga interface. It manages access to the
LSAOrga and LSAOrgaLog database and handles the units and types, hereby giving access to all the
objects of the LSAOrga.
It holds methods to create and get units and type definitions from the LSAOrga. If you want to work with
these objects you always need to get them with the LSAOrgaManager.
- Author:
-
LPS EMEA
- Version:
-
2.0, 01.OCT.2000
- History:
| 09.May.2000 | RPr | changed errorhandlers with Errormessages
16.NOV.2000 RPr new documentation
|
| Method Summary |
Sub Delete () |
Function getAddressDocsByKey (key As String) As NotesDocumentCollection |
Function GetNotesDatabaseByAliasParameter (AliasName As String, DefaultAliasName As String) As NotesDatabase |
Function GetNotesDatabaseByDBParameter (DBase As Variant) As NotesDatabase |
Function GetOrgaDocByKey (OrgaView As String, Key As String) As NotesDocument |
Function GetOrgaTypeS (OrgaView As String) As Variant |
Function GetTypeByExtSyncKey (ExtSystem As String, ExtSyncKey As String) As LSAOrgaType |
Function GetTypeByName (OrgaName As String) As LSAOrgaType |
Function GetUnitByExtSyncKey (ExtSystem As String, ExtSyncKey As String) As LSAOrgaUnit |
Function GetUnitByName (OrgaInternalName As String) As LSAOrgaUnit |
Function GetUnitByNotesName (OrgaNotesName As NotesName) As LSAOrgaUnit |
Sub IsOrgaDB (DBase As NotesDatabase) |
Sub New (Database As Variant, OrgaDBAlias As String, LogDatabase As Variant, LogDBAlias As String) |
Function NewOrgaCollection (ExtSystem As String, OrgaClassName As Variant, NotesName As Variant, OrgaTypeName As Variant) As LSAOrgaCollection |
Function NewType (OrgaName As String, OrgaSubtype As String) As LSAOrgaType |
Function NewUnit (OrgaName As String, OrgaType As LSAOrgaType, OrgaNotesName As String, OrgaNotesType As String) As LSAOrgaUnit |
Sub null () |
Function PopulateAllChanges () As Integer |
Public Property Get GroupTypeS AsVariant
This property returns an array of strings with the names of all group types from the LSA Orga metamodel.
Use Case:
You want to get all group type objects of the LSAOrga
Dim OrgaManager As LSAOrgaManager
Dim allGroupTypeNames As Variant
Dim allGroupTypes As LSAOrgaCollection
Dim aOrgaType As LSAOrgaType
Dim aTypeName As String
Set OrgaManager = New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
allGroupTypeNames = OrgaManager.GroupTypeS
Set allGroupTypes = New LSAOrgaCollection
Forall aGroupTypeName In allGroupTypeNames
aTypeName = aGroupTypeName
Set aOrgaType = OrgaManager.GetTypeByName(aTypeName)
Call allGroupTypes.AddEntry(aOrgaType)
End Forall
- Returns:
| GroupTypes | Variant array of strings
|
- History:
Public Property Get TraitTypeS AsVariant
This property returns an array of strings with the names of all trait types from the LSA Orga metamodel.
Use Case:
You want to get all trait type objects of the LSAOrga
Dim OrgaManager As LSAOrgaManager
Dim allTraitTypeNames As Variant
Dim allTraitTypes As LSAOrgaCollection
Dim aOrgaType As LSAOrgaType
Dim aTypeName As String
Set OrgaManager = New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
allTraitTypeNames = OrgaManager.TraitTypeS
Set allTraitTypes = New LSAOrgaCollection
Forall aTraitTypeName In allTraitTypeNames
aTypeName = aTraitTypeName
Set aOrgaType = OrgaManager.GetTypeByName(aTypeName)
Call allTraitTypes.AddEntry(aOrgaType)
End Forall
- Returns:
| TraitTypes | Variant array of strings
|
- History:
Public Property Get PersonTypeS AsVariant
This property returns an array of strings with the names of all person types from the LSA Orga metamodel.
Use Case:
You want to get all person type objects of the LSAOrga
Dim OrgaManager As LSAOrgaManager
Dim allPersonTypeNames As Variant
Dim allPersonTypes As LSAOrgaCollection
Dim aOrgaType As LSAOrgaType
Dim aTypeName As String
Set OrgaManager = New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
allPersonTypeNames = OrgaManager.PersonTypeS
Set allPersonTypes = New LSAOrgaCollection
Forall aPersonTypeName In allPersonTypeNames
aTypeName = aPersonTypeName
Set aOrgaType = OrgaManager.GetTypeByName(aTypeName)
Call allPersonTypes.AddEntry(aOrgaType)
End Forall
- Returns:
| PersonTypes | Variant array of strings
|
- History:
Public Property Set SurrogationDate AsNotesDateTime
Public Property Get SurrogationDate AsNotesDateTime
Public Property Get CurrentOrgaDatabase AsNotesDatabase
This method returns an NotesDatabase object of the current LSA Orga database.
Usually is not necessary to get this object as all objects of this interface know the LSAOrga database,
and the LSAOrgaManager also checks if it exists and has the correct format.
In the config database you can find all the information about the LSA Orga database by the alias of it.
Please have in mind that you should not directly work with the documents in the LSAOrga!
- Returns:
- History:
Public Property Get CurrentLog AsLSAOrgaLog
This method returns an LSAOrgaLog object, which reflects the current log database.
If you want to create your own log documents, please use the "LSAOrgaLog" class.
- Returns:
- History:
Public Property Get ViewAddresses AsNotesView
Public Property Get ViewAllOrgaDocs AsNotesView
Public Property Get AddressDB AsNotesDatabase
Public Property Get InstanceID AsString
Public Property Get AddressLUView AsNotesView
Public Property Get ContactLUView AsNotesView
Public Property Get OrganizationLUView AsNotesView
Public Property Get IdLUView AsNotesView
Public Property Get CustomerLUView AsNotesView
Public Property Get AttributeArray AsVariant
Public Property Get LabelTypes AsVariant
Public Property Get LabelFormats AsVariant
Public Property Get OpeningTypes AsVariant
Public Property Get OpeningFormats AsVariant
Public Property Get ClosingTypes AsVariant
Public Property Get ClosingFormats AsVariant
Public Property Get ContactDisplayRule AsString
Public Property Get OrganizationDisplayRule AsString
Public Property Get PhoneFormat AsString
Public Property Set PhoneFormat AsString
Public Property Get CountriesWithoutAreaCode AsVariant
New
Public Sub New(Database As Variant,OrgaDBAlias As String,LogDatabase As Variant,LogDBAlias As String)
Constructor of class
Example:
Dim OrgaManager as LSAOrgaManager
Set OrgaManager = New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
- Parameters:
| OrgaDB | Variant | reference to the LSAOrga database, this can be any of the following :
string : "Server!!Path";
array of strings : "Server" : "Path";
NotesDatabase : a NotesDatabase object;
string : "" (empty string) -> ignore this parameter and use the second
|
| OrgaAlias | String | LSA alias name of the database as configured in the LSA Configure database
if this parameter is empty, the default alias "LSAOrga" is used
|
| OrgaLog | Variant | reference to the LSAOrgaLog database, this can be any of the following :
string : "Server!!Path"
array of strings : "Server":"Path"
NotesDatabase : a NotesDatabase object
string : "" (empty string) -> ignore this parameter and use the fourth
|
| OrgaLogAlias | String | LSA alias name of the database as configured in the LSA Configure database
if this parameter is empty, the default alias "LSAOrgaLog" is used
|
- Returns:
- History:
Delete
Public Sub Delete
PopulateAllChanges
Public Function PopulateAllChanges As Integer
This method runs the update on the LSAOrga hierarchy. After any changes to LSA Orga objects that affect
other units (e.g. name change of a person affects the group where the person is member), the
programmer must call this method in order to make the database consistent.
In the LSA Orga view "Administration:UpdateResponses" you can find all update request documents which were
created. These have to be processed by the "PopulateAllChanges" method - it calls the agent with the same
name.
For more information about the settings for this agent please refer to the Help database of the LSAOrga.
- History:
GetTypeByName
Public Function GetTypeByName(OrgaName As String) As LSAOrgaType
This method searches the LSA Orga database for a LSA Type object identified by name.
If this type does not exist, the error 1756 is generated.
Further you get an entry in the LSAOrga Log database - as for this example:
"LSAOrgaManager: Error 1756 - Could not find a type document by the name [OrgaTypeName] in LSA organization
database".
Use Case:
If you want to create an new Orga Unit you must have a LSAOrgaType object - for instance a new orga unit of
the Type "Department".
Dim OrgaType as LSAOrgaType
Dim OrgaManager as New LSAOrgaManager("","LSAORGA","","LSAORGALOG")
Dim Unit as LSAOrgaUnit
'Create a new Department unit:
Set OrgaType = OrgaManager.GetTypeByName("Department")
Set Unit = OrgaManager.NewUnit("Sales", OrgaType, "Sales", "0")
Call Unit.Save()
Delete Unit
- Parameters:
| OrgaName | String | The name of the LSA Orga type object
|
- Returns:
- Errors:
| 1756 | ErrOrgaIntNoTypeByName No object found by the given name
|
- History:
GetTypeByExtSyncKey
Public Function GetTypeByExtSyncKey(ExtSystem As String,ExtSyncKey As String) As LSAOrgaType
This method searches the LSA Orga database for a LSA Type object identified by a external
system/key combination.
If the type could not be found, you get the error 1757.
In the Log database a document is created which shows this error:
"LSAOrgaManager: Error 1757 - Could not find a type document by the external syncronisation key [ExtSystem:ExtSyncKey]
in LSA organization database".
Use Case:
You can use this method to get the OrgaType when you want to create a new unit of that type. In this example
in the source document for the Unit you have also the information about the type.
Dim OrgaType as LSAOrgaType
Dim OrgaManager as New LSAOrgaManager("","LSAORGA","","LSAORGALOG")
Dim Unit as LSAOrgaUnit
Dim docSource as NotesDocument
dim nameSource as String
dim keyInSource as string
dim sourceTypeName as String
'Create a new unit from the source document:
....
nameSource = "Phonebook"
sourceTypeName = docSource.OrganizationalClassName(0)
Set OrgaType = OrgaManager.GetTypeByExtSyncKey(nameSource,sourceTypeName)
keyInSource = docSource.EntryName(0)
Set Unit = OrgaManager.NewUnit(keyInSource, OrgaType, "Orga" + keyInSource, "0")
Call Unit.Save()
Delete Unit
- Parameters:
| ExtSytem | String | The name of the external system
|
| ExtSyncKey | String | The external key that identifies the object with the given system
|
- Returns:
- Errors:
| 1757 | ErrOrgaIntNoTypeByExtSyncKey No object found by given system/key
|
- History:
GetUnitByName
Public Function GetUnitByName(OrgaInternalName As String) As LSAOrgaUnit
This method searches the LSA Orga database for a LSA Unit object identified by name.
You can also use this method to find out if a unit with this name already exists.
If the unit was not found, the error 1758 (in older versions 1757) is generated.
In the Log database a document is created which shows this error:
"LSAOrgaManager: Error 1758 - Could not find a unit document by the name [OrgaUnitName] in LSA
organization database".
Use Case:
If you want to set new values to a unit document in the LSA Orga you need to get the object of that unit.
For example, the unit has the Name "Sales2".
Dim OrgaManager as New LSAOrgaManager("","LSAORGA","","LSAORGALOG")
Dim Unit as LSAOrgaUnit
Dim unitName as String
unitName = "Sales2"
set unit = OrgaManager.GetUnitByName(unitName)
....
call Unit.Save()
Delete Unit
- Parameters:
| OrgaInternalName | String | The name of the LSA Orga unit object
|
- Returns:
- Errors:
| 1758 | (1757) ErrOrgaIntNoUnitByName No object found by the given name
|
- History:
GetUnitByNotesName
Public Function GetUnitByNotesName(OrgaNotesName As NotesName) As LSAOrgaUnit
This method searches the LSA Orga database for a LSA Unit object identified by the NAB name. You can also use this method to find out if a unit with this notes name already exists.
If the unit was not found, the error 1759 is generated.
In the Log database a document is created which shows this error:
"LSAOrgaManager: Error 1759 - Could not find a unit document by the notes name [UnitNotesName] in LSA
organization database". (In older version the number shown is 1758).
Use Case:
If you want to set new values to a unit document in the LSA Orga you need to get the object of that unit.
For example, the unit has the Notes Name "OrgaSales2".
Dim OrgaManager as New LSAOrgaManager("","LSAORGA","","LSAORGALOG")
Dim Unit as LSAOrgaUnit
Dim unitName as String
unitName = "OrgaSales2"
set unit = OrgaManager.GetUnitByNotesName(unitName)
....'change the values of that unit
call Unit.Save()
Delete Unit
- Parameters:
| OrgaNotesName | String | The NAB name of the LSA Orga unit object
|
- Returns:
- Errors:
| 1759 | ErrOrgaIntNoUnitByNotesName No object found by the given NAB name
|
- History:
GetUnitByExtSyncKey
Public Function GetUnitByExtSyncKey(ExtSystem As String,ExtSyncKey As String) As LSAOrgaUnit
This method searches the LSA Orga database for a LSA Unit object identified by an external
system/key combination.
If the unit was not found, the error 1750 is generated (in older versions no error is generated).
In the Log database no document is created!
Use Case:
If you want to set new values to a unit document in the LSA Orga you need to get the object of that unit.
You can also use this method to find out if a unit with this ID already exists in the LSAOrga.
For example, there is a source document which has the external syncronization key in the field "MyID" .
Dim OrgaManager as New LSAOrgaManager("","LSAORGA","","LSAORGALOG")
Dim Unit as LSAOrgaUnit
Dim docSource as NotesDocument
dim nameSource as String
dim sourceUnitName as String
'Find a the unit from the source document:
....
nameSource = "Phonebook"
sourceUnitName = docSource.MyID(0)
set unit = OrgaManager.GetUnitByExtSyncKey(nameSource,sourceUnitName)
....'change the properties of that unit
call Unit.Save()
Delete Unit
- Parameters:
| ExtSystem | String | The name of the external system
|
| ExtSyncKey | String | The external key that identifies the object with the given system
|
- Returns:
- Errors:
| 1750 | ErrOrgaIntNoUnitByExtSyncKey No object found by given system/key
|
- History:
| 04.APR.2000 | gg | redesign
13.NOV.2000 RPr no logging but generate error
|
NewOrgaCollection
Public Function NewOrgaCollection(ExtSystem As String,OrgaClassName As Variant,NotesName As Variant,OrgaTypeName As Variant) As LSAOrgaCollection
This method fills a collection with LSA Orga objects that match the given criteria.
Every parameter can have the value "" (empty string). At least one of these parameters must have a valid
value to find OrgaUnits or OrgaTypes. OrgaTypes are only returned if you specify the OrgaClassName with
"OrgaType". If you specify "OrgaType" you must not specify any other OrgaClassName. Search for OrgaTypes only
works correct from LiSA Version 2.0c .
If no matching objects were found, an empty LSAOrgaCollection is returned (.Count = 0, .GetFirst Is Nothing).
Use Case:
You want to find all Person units which were imported from the external system "Phonebook"
Dim OrgaManager as New LSAOrgaManager("","LSAORGA","","LSAORGALOG")
Dim allPersons as LSAOrgaCollection
Dim extSystemName as string
'Create Collection with all imported persons:
extSystemName = "Phonebook"
set allPersons = OrgaManager.NewOrgaCollection(extSystemName,"OrgaPerson","","")
- Parameters:
| ExtSystem | String | objects are filtered by external system (must have been set by .SyncInfo for units or types)
|
| OrgaClassName | Variant | String or array of strings. Objects are filtered by the
LSA Orga Subtype ("OrgaGroup", "OrgaPerson"," OrgaTrait" and/or "OrgaType").
|
| NotesName | Variant | String or array of strings. objects are filtered by the
given NAB names.
|
| OrgaTypeName | Variant | String or array of strings. objects are filtered by LSA
Orga type names. The type names can be retrieved by attributes of the LSAOrgaManager
(LSAOrgaManager.PersonTypes ...).
|
- Returns:
- Errors:
| ErrOrgaIntIllegalDocType | An illegal document was found in the LSA Orga database. This error will
also occur if AddressDocuments, UpdateRequests or otherbackend documents were found. That's why it is very
important that at least one search parameter is set to a valid value to find either types or units .
|
- History:
| 04.APR.2000 | gg | redesign
17.11.2000 RPr Bugfix Check Type Definitions
|
NewType
Public Function NewType(OrgaName As String,OrgaSubtype As String) As LSAOrgaType
This method creates a new LSAOrgaType object (orga type).
The default values for a Type Definition are:
- no address interface
- owners may delete units of this type
- groups will have "Multipurpose" NAB-Group Type
- persons will have "choose when created" as setting for the Type Category (Import from NAB or not)
- no customer subform
- no view icon
- for trait types the label for assigned units is "associated units"
All these settings can be overwritten by accessing the properties of this new orga type.
A new orga type must be saved before it exists in the LSAOrga and before you can use it to create new units
of this orga type.
Use Case:
You can create new type definitions depending on the data you get from an external system.
Dim OrgaType as LSAOrgaType
Dim OrgaManager as New LSAOrgaManager("","LSAORGA","","LSAORGALOG")
Dim Unit as LSAOrgaUnit
Dim docSource as NotesDocument
dim nameSource as String
dim keyInSource as string
dim sourceTypeName as String
'Create a new type from the source document:
....
nameSource = "Phonebook"
sourceTypeName = docSource.OrganizationalClassName(0)
Set OrgaType = OrgaManager.GetTypeByExtSyncKey(nameSource,sourceTypeName)
If OrgaType Is Nothing Then
'we must create this Type:
set OrgaType = OrgaManager.NewType(docSource.OrganizationalClassName(0), "OrgaGroup")
End if
- Parameters:
| OrgaName | String | The name of the type object (for instance "Department")
|
| OrgaSubtype | String | defines which kind of type object is to be created
("OrgaGroup", "OrgaPerson" or "OrgaTrait").
|
- Returns:
- History:
NewUnit
Public Function NewUnit(OrgaName As String,OrgaType As LSAOrgaType,OrgaNotesName As String,OrgaNotesType As String) As LSAOrgaUnit
This method creates a new LSAOrgaUnit object. The unit will be created according to the values of the type
definition in OrgaType. You must save the unit before it exists in the Orga database and before you can assign
it as child, parent or surrogate to other units!
Use Case:
If you have a synchronization with an external system, you might want to create new units according to the
documents from the external system like a phonebook, for instance.
Dim OrgaType as LSAOrgaType
Dim OrgaManager as New LSAOrgaManager("","LSAORGA","","LSAORGALOG")
Dim Unit as LSAOrgaUnit
Dim docSource as NotesDocument
Dim unitName as String
dim nameSource as String
dim sourceTypeName as String
'Create or update the unit from the source document:
unitName = docSource.NameField(0)
Set unit = orgaMgr.getUnitByName( UnitName)
If unit Is Nothing Then ' The unit is new
' Get unitType - according to a field in the docSource
Set OrgaType = orgaMgr.GetTypeByName(docSource.OrganizationalClassName(0))
' Create new unit:
Set unit = orgaMgr.NewUnit(UnitName, OrgaType, docSource.EntryName(0), "0")
....
call unit.save
Delete unit
End If
- Parameters:
| OrgaName | String | The name of the unit object ("Marketing Department")
|
| OrgaType | LSAOrgaType | An instance of the LSA Orga type which defines the unit.
|
| OrgaNotesName | String | The NAB name of the unit, can be "" (empty string). If the OrgaNotesName is "",
the OrgaNotesType must be "5" for a group or trait, or "Interface" or "Orga" for person units. If you choose
"Orga", the person unit cannot be set a NotesName later on. If you have specified the unit to have a NotesName
but do not set one in this method or before you save the unit the first time, the unit will not be saved!
|
| OrgaNotesType | String | If the unit is a group, this parameter defines the type of the resulting NAB
group ("0" = multi purpose, "1" = mail only, "2" = ACL only "3" = deny list only, "5" = no group in the NAB).
If you have a unit of a person type, the parameter can be "NAB", "Orga" or "Interface" where "NAB" means, the
person data are imported from the NAB (you should never create a person with the interface classes and set
this value to "NAB"!). If you have the value "Orga" for the NotesType, there will be no NotesName for this
person unit. This would mean, that these persons will not be shown as group members in the Domino Directory.
From the backend you should set the value "Interface" which gives the opportunity to create the unit without
a NotesName and change this later by setting a NotesName via the Backend classes.
The NotesType also must fit the setting in the type definition: for groups, traits and persons all values can
be chosen if this parameter in the type definition is set to "Choose when created /4". In all other cases the
NotesType will be calculated from the type definition independently from the parameter in the new unit.
|
- Returns:
- History:
getAddressDocsByKey
Public Function getAddressDocsByKey(key As String) As NotesDocumentCollection
GetNotesDatabaseByAliasParameter
Private Function GetNotesDatabaseByAliasParameter(AliasName As String,DefaultAliasName As String) As NotesDatabase
GetOrgaDocByKey
Private Function GetOrgaDocByKey(OrgaView As String,Key As String) As NotesDocument
GetOrgaTypeS
Private Function GetOrgaTypeS(OrgaView As String) As Variant
IsOrgaDB
Private Sub IsOrgaDB(DBase As NotesDatabase)
GetNotesDatabaseByDBParameter
Private Function GetNotesDatabaseByDBParameter(DBase As Variant) As NotesDatabase
null
Public Sub null
| Top | LotusScript Doc |
| © Lotus Professional Services |
| generated on : 05-Apr-01 8:39:59 AM |